<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="utf-8">
<!-- linuxdev.qdoc -->
  <title>Connecting Embedded Linux Devices | Qt Creator Manual</title>
  <link rel="stylesheet" type="text/css" href="style/offline-simple.css" />
  <script type="text/javascript">
    document.getElementsByTagName("link").item(0).setAttribute("href", "style/offline.css");
    // loading style sheet breaks anchors that were jumped to before
    // so force jumping to anchor again
    setTimeout(function() {
        var anchor = location.hash;
        // need to jump to different anchor first (e.g. none)
        location.hash = "#";
        setTimeout(function() {
            location.hash = anchor;
        }, 0);
    }, 0);
  </script>
</head>
<body>
<div class="header" id="qtdocheader">
  <div class="main">
    <div class="main-rounded">
      <div class="navigationbar">
        <table><tr>
<td ><a href="index.html">Qt Creator Manual</a></td><td >Connecting Embedded Linux Devices</td></tr></table><table class="buildversion"><tr>
<td id="buildversion" width="100%" align="right"><a href="index.html">Qt Creator Manual 4.11.1</a></td>
        </tr></table>
      </div>
    </div>
<div class="content">
<div class="line">
<div class="content mainContent">
  <link rel="prev" href="creator-developing-baremetal.html" />
  <link rel="next" href="creator-developing-ios.html" />
<p class="naviNextPrevious headerNavi">
<a class="prevPage" href="creator-developing-baremetal.html">Connecting Bare Metal Devices</a>
<span class="naviSeparator">  &#9702;  </span>
<a class="nextPage" href="creator-developing-ios.html">Connecting iOS Devices</a>
</p><p/>
<div class="sidebar">
<div class="toc">
<h3><a name="toc">Contents</a></h3>
<ul>
<li class="level2"><a href="#configuring-ssh-connections">Configuring SSH Connections</a></li>
<li class="level2"><a href="#generating-ssh-keys">Generating SSH Keys</a></li>
<li class="level2"><a href="#managing-device-processes">Managing Device Processes</a></li>
</ul>
</div>
<div class="sidebar-content" id="sidebar-content"></div></div>
<h1 class="title">Connecting Embedded Linux Devices</h1>
<span class="subtitle"></span>
<!-- $$$creator-developing-generic-linux.html-description -->
<div class="descr"> <a name="details"></a>
<p>You can connect embedded Linux devices to the development PC to run, debug, and analyze applications built for them from Qt Creator.</p>
<p>If you have a tool chain for building applications for embedded Linux devices installed on the development PC, you can add it to Qt Creator. You can then select a <a href="creator-glossary.html#glossary-buildandrun-kit">kit</a> with <b>Embedded Linux</b> device type to build applications for and run them on embedded Linux devices.</p>
<p>To be able to run and debug applications on embedded Linux devices, you must add devices and select them in the Qt Creator <a href="creator-glossary.html#glossary-buildandrun-kit">kit</a>.</p>
<p>You use a wizard to create the connections. You can edit the settings later in <b>Tools</b> &gt; <b>Options</b> &gt; <b>Devices</b> &gt; <b>Devices</b>.</p>
<p class="centerAlign"><img src="images/qtcreator-linux-device-configurations.png" alt="&quot;Devices dialog&quot;" /></p><p>You can protect the connections between Qt Creator and a device by using an <a href="https://www.openssh.com/">OpenSSH</a> connection. OpenSSH is a connectivity tool for remote login using the SSH protocol. The OpenSSH suite is not delivered with Qt Creator, so you must download it and install it on the development PC. Then, you must configure the paths to the tools in Qt Creator. For more information, see <a href="creator-developing-generic-linux.html#configuring-ssh-connections">Configuring SSH Connections</a>.</p>
<p>You need either a password or an SSH public and private key pair for authentication. If you do not have an SSH key, you can use the ssh-keygen tool to create it in Qt Creator. For more information, see <a href="creator-developing-generic-linux.html#generating-ssh-keys">Generating SSH Keys</a>.</p>
<p><b>Note: </b>Qt Creator does not store passwords, so if you use password authentication, you may need to enter the password on every connection to the device, or, if caching is enabled, at every Qt Creator restart.</p><p>To configure connections between Qt Creator and an embedded Linux device and to specify build and run settings for the device:</p>
<ol class="1" type="1"><li>Make sure that your device can be reached via an IP address.</li>
<li>Select <b>Tools</b> &gt; <b>Options</b> &gt; <b>Kits</b> &gt; <b>Qt Versions</b> &gt; <b>Add</b> to add the Qt version for embedded Linux.</li>
<li>Select <b>Tools</b> &gt; <b>Options</b> &gt; <b>Kits</b> &gt; <b>Compilers</b> &gt; <b>Add</b> to add the compiler for building the applications.</li>
<li>To deploy applications and run them remotely on devices, specify parameters for accessing the devices:<ol class="1" type="1"><li>Select <b>Tools</b> &gt; <b>Options</b> &gt; <b>Devices</b> &gt; <b>Devices</b> &gt; <b>Add</b> &gt; <b>Generic Linux Device</b> &gt; <b>Start Wizard</b>.<p class="centerAlign"><img src="images/qtcreator-screenshot-devconf-linux.png" alt="&quot;Connection Data wizard&quot;" /></p></li>
<li>In the <b>The name to identify this configuration</b> field, enter a name for the connection.</li>
<li>In the <b>The device's host name or IP address</b> field, enter the host name or IP address of the device. This value will be available in the variable <code>%{Device:HostAddress}</code>.</li>
<li>In the <b>The username to log into the device</b> field, enter the username to log into the device and run the application as. This value will be available in the variable <code>%{Device:UserName}</code>.</li>
<li>In the <b>The authentication type</b> field, select <b>Default</b> to use the currently displayed private key file for authentication. Select <b>Specific Key</b> to use some other key, and enter the path to the file that contains the private key in the field below. This value will be available in the variable <code>%{Device:PrivateKeyFile}</code>.</li>
<li>Click <b>Next</b> to create the connection.</li>
</ol>
<p>All of these parameters can be edited later, as well as additional ones that the wizard does not show because there are sensible default values. One of these is the SSH port number, which is available in the variable <code>%{Device:SshPort}</code>.</p>
</li>
<li>Select <b>Tools</b> &gt; <b>Options</b> &gt; <b>Kits</b> &gt; <b>Add</b> to add a kit for building for the device. Select the Qt version, compiler, and device that you added above, and choose <b>Generic Linux Device</b> for the device type.</li>
<li>To specify build settings:<ol class="1" type="1"><li>Open a project for an application you want to develop for the device.</li>
<li>Select <b>Projects</b> &gt; <b>Build &amp; Run</b> to enable the kit that you specified above.</li>
</ol>
</li>
<li>Select <b>Run</b> to specify run settings. Usually, you can use the default settings.<p>When you run the project, Qt Creator deploys the application as specified by the deploy steps. By default, Qt Creator copies the application files to the device. For more information, see <a href="creator-deployment-embedded-linux.html">Deploying Applications to Embedded Linux Devices</a>.</p>
</li>
</ol>
<a name="configuring-ssh-connections"></a>
<h3 id="configuring-ssh-connections">Configuring SSH Connections</h3>
<p>SSH connections are established via an OpenSSH client running in master mode, if possible. Connection sharing is enabled by default to allow sharing multiple sessions over a single SSH connection. This way, a connection is only established once and then re-used by subsequent run and deploy procedures, saving connection setup overhead particularly with embedded devices. Because connection sharing is not supported on Windows, a new SSH connection is created for each deploy or run procedure.</p>
<p>To create SSH connections, you must install the <a href="https://www.openssh.com/">OpenSSH</a> suite, which includes the ssh, sftp, and ssh-keygen tools on the development PC.</p>
<p>To tell Qt Creator where it can find the tools, specify the paths to the directories where the tools are installed in <b>Tools</b> &gt; <b>Options</b> &gt; <b>Devices</b> &gt; <b>SSH</b>:</p>
<p class="centerAlign"><img src="images/qtcreator-ssh-options.png" alt="" /></p><ul>
<li>Deselect the <b>Enable connection sharing</b> check box to create a new SSH connection for each deploy and run procedure. This option is grayed on Windows, where connection sharing is not supported.</li>
<li>In the <b>Connection sharing timeout</b> field, specify the timeout for reusing the SSH connection in minutes.</li>
<li>In the <b>Path to ssh executable</b> field, enter the path to the directory where the OpenSSH executable is installed.</li>
<li>In the <b>Path to sftp executable</b> field, enter the path to the directory where the SFTP executable is installed.</li>
<li>In the <b>Path to ssh-askpass executable</b> field, enter the path to the directory where the ssh-askpass executable is installed. Usually, you can use the default path that points to the implementation of the tool delivered with Qt Creator, qtc-askpass.</li>
<li>In the <b>Path to ssh-keygen executable</b> field, enter the path to the directory where the ssh-keygen executable is installed.</li>
</ul>
<a name="generating-ssh-keys"></a>
<h3 id="generating-ssh-keys">Generating SSH Keys</h3>
<p>If you do not have an SSH public and private key pair, you can generate it in Qt Creator. The connection wizard can create the key pair for you, or you can create it separately.</p>
<p>You can specify key length and the key algorithm, RSA or ECDSA. If you only use the keys to protect connections to the emulator or device, you can use the default values.</p>
<ol class="1" type="1"><li>Select <b>Tools</b> &gt; <b>Options</b> &gt; <b>Devices</b> &gt; <b>Devices</b> &gt; <b>Create New</b>.<p class="centerAlign"><img src="images/qtcreator-ssh-key-configuration.png" alt="&quot;SSH Key Configuration dialog&quot;" /></p></li>
<li>In the <b>Private key file</b> field, select the location to save the private key.<p>The <b>Public key file</b> field displays the location to save the corresponding public key.</p>
</li>
<li>Select <b>Generate And Save Key Pair</b> to generate and save the keys at the specified locations.</li>
</ol>
<a name="managing-device-processes"></a>
<h3 id="managing-device-processes">Managing Device Processes</h3>
<p>You can view processes running on devices and kill them. Select <b>Tools</b> &gt; <b>Options</b> &gt; <b>Devices</b> &gt; <b>Devices</b> &gt; <b>Show Running Processes</b>.</p>
<p>You can filter the processes by name or ID in the <b>List of Processes</b> dialog.</p>
<p>To update the process list, select <b>Update List</b>.</p>
<p>To kill a process, select it in the list, and then select <b>Kill Process</b>.</p>
</div>
<!-- @@@creator-developing-generic-linux.html -->
<p class="naviNextPrevious footerNavi">
<a class="prevPage" href="creator-developing-baremetal.html">Connecting Bare Metal Devices</a>
<span class="naviSeparator">  &#9702;  </span>
<a class="nextPage" href="creator-developing-ios.html">Connecting iOS Devices</a>
</p>
        </div>
       </div>
   </div>
   </div>
</div>
<div class="footer">
   <p>
   <acronym title="Copyright">&copy;</acronym> 2019 The Qt Company Ltd.
   Documentation contributions included herein are the copyrights of
   their respective owners.<br>    The documentation provided herein is licensed under the terms of the    <a href="http://www.gnu.org/licenses/fdl.html">GNU Free Documentation    License version 1.3</a> as published by the Free Software Foundation.<br>    Qt and respective logos are trademarks of The Qt Company Ltd.     in Finland and/or other countries worldwide. All other trademarks are property
   of their respective owners. </p>
</div>
</body>
</html>
